package org.grow.commodity.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-8-6
 */

@RestControllerAdvice
public class ExceptionBridge {

    /**
    * 商品基础资料 异常范围 810-819
    * 供应商资料 异常范围 820-829
    * 库存资料 异常范围830-839
     * * * 采购单资料 异常范围850-859
    * */
    @ExceptionHandler(CommodityException.class)
    public ResponseEntity<String> commodityException(CommodityException e){
        return new ResponseEntity<>(e.getMessage(),null,e.getCode());
    }

}
